home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / utility / xset402.zip / XSET.DOC < prev    next >
Text File  |  1994-03-29  |  53KB  |  1,344 lines

  1.     
  2.                ╔═════════════════════════════════════════════╗
  3.                ║     XSET 4.02 : Extended SET Instruction    ║░░
  4.                ║                                             ║░░
  5.                ║       (C) 1991-1994 Stern Marc              ║░░
  6.                ╚═════════════════════════════════════════════╝░░
  7.                 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  8.  
  9.  
  10.     Everything you always wanted to put in an environment  variable  but
  11.     were afraid to ask DOS for . . . 
  12.  
  13.         XSET: The easy way to write efficient batch files.
  14.  
  15.     XSET allows you to put EVERYTHING you want  in  a  variable  of  the
  16.     current DOS environment and use it as if you assigned it the value  with
  17.     the standard DOS command 'SET'. You will be able to write very efficient
  18.     batch files including string manipulation, calculation, ...
  19.  
  20.     XSET is the most powerful environment variables manipulation program
  21.     you ever saw. It also has a very easy and intuitive user interface (very
  22.     close to the DOS 'SET' command). It is not a  resident  program;  it  so
  23.     cannot interfere with any of your other applications.
  24.  
  25.     XSET is fully compatible with MS-DOS (from 3.30), DR-DOS, NDOS & 4DOS.
  26.  
  27.  
  28.     XSET has seven major features:
  29.     ═════════════════════════════
  30.  
  31.      - XSET permits  to  catch  the  output  of  any  command  (internal  or
  32.        external) or program and put it into an environment variable.
  33.  
  34.      - XSET has built-in commands to modify the output of  a  program  or  a
  35.        string given on the command-line (extract a part of a string, ...)
  36.  
  37.      - XSET has a built-in full  floating-point  calculation  functionality:
  38.        You can program incremental loops, input  a  calculation  string  and
  39.        output the resulting number, ...
  40.  
  41.      - XSET can manage variable contents of more than 128  characters  (your
  42.        path can now be as long as you want).
  43.  
  44.      - XSET has other built-in commands to give you access  to  some  system
  45.        data (date, time, ...)
  46.                   
  47.      - XSET has built-in commands to clear  all  environment  or  restore  a
  48.        previously saved one.
  49.                 
  50.      - XSET gives you  access  to  high-level  user  interface  input/output
  51.        (line-editing, colors, windows, boxes, ...).
  52.  
  53.  
  54.      More than sixty commands to do all what you need.
  55.  
  56.  
  57.                                                                     Page 1
  58.  
  59.                        ╔═════════════════════════════╗
  60.                        ║      Table of contents      ║░░
  61.                        ╚═════════════════════════════╝░░
  62.                         ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  63.       
  64.  
  65.     The Shareware concept .................................... Page 2
  66.  
  67.     How to use XSET .......................................... Page 3
  68.  
  69.     Examples of use .......................................... Page 4
  70.  
  71.     Syntax explanation ....................................... Page 7
  72.  
  73.     Input explanation ........................................ Page 7
  74.  
  75.     Options and commands description ......................... Page 8
  76.       Input related flags .................................... Page 8
  77.       Prompt related flags ................................... Page 9
  78.       String related flags ................................... Page 10
  79.       Other flags ............................................ Page 11
  80.       Order of execution of /options ......................... Page 13
  81.       Input commands ......................................... Page 14
  82.       Date & time commands ................................... Page 15
  83.       Disk & file commands ................................... Page 16
  84.       Other commands ......................................... Page 19
  85.       Special flags .......................................... Page 20
  86.  
  87.     XSET & XSET_MSG variables ................................ Page 21
  88.  
  89.     Installation ............................................. Page 22
  90.  
  91.     Problems ................................................. Page 22
  92.     
  93.     Batch file programming: Hints & tips ..................... Page 24
  94.  
  95.     Additional information - How to contact the author ....... Page 25
  96.  
  97.     Appendix: E-mail address from other sites ................ Page 25
  98.  
  99.  
  100.                                                                     Page 2
  101.  
  102.                        ╔═════════════════════════════╗
  103.                        ║    The Shareware concept    ║░░
  104.                        ╚═════════════════════════════╝░░
  105.                         ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  106.  
  107.  
  108.     This package is Shareware.
  109.  
  110.     That means that you may try it for evaluation and, if you like  it,  you
  111.     should  consider  to  pay   the   registration   fee   (see   the   file
  112.     'REGISTER.HOW'). You will then become a  registered  user  and  so  have
  113.     access to free support, free correction of acknowledged  bugs  and  free
  114.     upgrades.
  115.  
  116.     Shareware also mean that you may distribute this package everywhere  and
  117.     to everybody you want, providing that you always distribute the complete
  118.     package. If you have access to any BBS, FTP server, E-mail server or any
  119.     other kind of software distribution, feel free to share  it  with  other
  120.     people; this may be useful for them and the more people  will  use  (and
  121.     register) a shareware program, the more stable it will be and  the  more
  122.     functionalities could be added.
  123.  
  124.  
  125.     Warning:   If you paid to get this package (e.g., it  was  onto a floppy
  126.     ───────    with other programs, you downloaded it from a BBS), you  only
  127.                paid for the physical support (the floppy,  the  transmission
  128.                fee, ...); this does not replace the registration fee.
  129.  
  130.  
  131.     Note to software distributors:
  132.     ─────────────────────────────
  133.  
  134.          Nobody is allowed to make any  benefit  by  distributing  the  XSET
  135.          package. Only regular distribution fees are allowed (price  of  the
  136.          floppy, of the network connection, ...).
  137.  
  138.  
  139.  
  140.                                                                     Page 3
  141.  
  142.     How to use XSET:
  143.     ═══════════════
  144.  
  145.     XSET will always  assign  what  you  tell  it  into  a  DOS  environment
  146.     variable. The main goals of XSET are: 
  147.  
  148.       - to ask a question to the user (through the keyboard),
  149.       - to catch the output of a program or a command,
  150.       - to get pieces of information like current date and  time,  timestamp
  151.         or size of a file, ...
  152.       - to modify a string (contained in another variable, in  a  parameter,
  153.         ...) like changing it to lower-/upper-case, performing a  search  on
  154.         it,  calculating  the   result   of   a   mathematical   expression,
  155.         substituting a sub-string by another or extracting a part of it,
  156.       - to handle variables longer than 128 characters.
  157.  
  158.  
  159.     There are four ways to use XSET.
  160.  
  161.     1. Like the normal DOS 'SET' command:
  162.        XSET myvar="This is a test string"
  163.  
  164.     2. To get an input from the user:
  165.        XSET answer
  166.  
  167.     3. To catch the output of a program or a command:
  168.        dir c:\programs\myprog.c | XSET myvar
  169.  
  170.     4. To get various system or environment information:
  171.        XSET myvar TIME
  172.  
  173.     Furthermore, to attain a high level of functionality  you  may  add,  to
  174.     each of the above syntaxs, several option flags to  modify  the  default
  175.     behavior of XSET (for example /UPPER to translate into upper-cases, ...).
  176.  
  177.  
  178.       Syntax:     XSET [/OPTIONS...]  <dosvar>
  179.       ──────      read a string from standard input
  180.  
  181.                   XSET [/OPTIONS...]  <dosvar>="string"
  182.                   equivalent to the DOS command 'SET'
  183.  
  184.                   XSET [/OPTIONS...]  <dosvar>  COMMAND  [arguments ...]
  185.     
  186.  
  187.           ╔══════════════════════════════════════════════════════╗
  188.           ║    Type XSET /? to get the full description          ║░░
  189.           ║    of all functionalities (parameters and effects).  ║░░
  190.           ╚══════════════════════════════════════════════════════╝░░
  191.             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  192.  
  193.  
  194.     Remark: Intensive use of XSET (and more  generally  of  DOS  environment
  195.              variables) may require that you expand the  size  of  your  DOS
  196.              environment space through the SHELL command. See  the  PROBLEMS
  197.              section for more details. 
  198.  
  199.                                                                     Page 4
  200.            
  201.     Examples of use:
  202.     ═══════════════
  203.  
  204.      Remark:  In all  the  examples,  the  command  XSET  and  its  built-in
  205.               commands are typed in upper-case and the environment variables
  206.               names are in lower-case. This is only  for  readability;  when
  207.               you type it, you may mix lower-cases and  upper-cases  as  you
  208.               like. The case is only significant for arguments  strings  you
  209.               enter on the command-line.
  210.  
  211.  
  212.      1)      XSET datvar DATE
  213.         Assigns the current system date into the variable 'datvar'
  214.  
  215.         Type the DOS command 'SET' to see all the  environment  variables;
  216.         you will get something like this:
  217.            ...
  218.            COMSPEC=...
  219.            DATVAR=dd-mm-yy  (where dd,mm,yy are replaced by current day, 
  220.                              month and year)
  221.            ... (other variables)
  222.  
  223.         You can now use the variable 'datvar' in a batch file:
  224.            ECHO the date is %datvar%
  225.  
  226.  
  227.      2)      XSET /COLOR LIGHTRED /PROMPT "Enter your name: " name 
  228.         Inputs  a  string  from  the  keyboard  (as  usual,  the  answer  is
  229.         terminated by <Enter>) and assigns it into the variable 'name'.  The
  230.         prompt appears in the specified color (or the  equivalent  attribute
  231.         on monochrome displays).
  232.  
  233.         You can now use the variable 'name' in a  batch  file  to  select  a
  234.         personalized environment for each user:
  235.            ECHO Hello %name%, have a good work session
  236.               CD \%name%
  237.  
  238.  
  239.      3)         You can write a batch file with automatic loops
  240.  
  241.  
  242.            rem ------------------
  243.  
  244.            set loop=1
  245.  
  246.         :next
  247.  
  248.               .......
  249.               anything you want
  250.               .......
  251.  
  252.               XSET /MATH loop=%loop% + 1
  253.               if not %loop% == 20 goto next
  254.  
  255.         rem ------------------
  256.  
  257.                                                                     Page 5
  258.  
  259.      4)         You can write a batch file where the user may enter  
  260.                 a calculation and use it as a number
  261.  
  262.       rem ------------------
  263.                                           
  264.       XSET /MATH /PROMPT "Enter your calculation: " calc
  265.  
  266.         echo result = %calc%
  267.  
  268.        rem ------------------
  269.  
  270.  
  271.  
  272.      5)         More elaborate example of a login procedure
  273.  
  274.           rem ---------------------- LOGIN.BAT --------------------------------
  275.  
  276.            @echo off
  277.           cls
  278.  
  279.         :BEGIN
  280.           rem       Ask login name from keyboard
  281.           rem       ----------------------------
  282.           XSET /PROMPT "Enter login name : " login
  283.  
  284.           rem       Test if directory corresponding to login name already exist
  285.           rem       -----------------------------------------------------------
  286.           if exist c:\%login%\nul goto OK
  287.  
  288.           rem       Directory does not exist, ask to create it
  289.           rem       ------------------------------------------
  290.           echo:
  291.           echo Login '%login%' does not exist.
  292.           rem       Only "yYnN" keys are allowed
  293.           rem       ----------------------------
  294.           XSET /PROMPT "Do you want to create it? (Y/N)" /UPPER ask KEY "YN"
  295.  
  296.         if %ask% == N goto BEGIN
  297.  
  298.           rem       Create directory
  299.           rem       ----------------
  300.           md c:\%login%
  301.  
  302.           :OK
  303.           set ask=
  304.  
  305.         rem     Go to user's directory and branch to personal
  306.         rem     batch file if any.
  307.         rem     ---------------------------------------------
  308.           cd \%login%
  309.           if exist autouser.bat autouser.bat
  310.  
  311.           rem -----------------------------------------------------------------
  312.  
  313.                                                                     Page 6
  314.  
  315.      6)         You are able to use a single password input for several 
  316.                 network connections
  317.  
  318.           rem -----------------------------------------------------------------
  319.  
  320.           echo off
  321.           cls
  322.  
  323.           rem    Ask login name from keyboard
  324.           rem    ----------------------------
  325.           XSET /PROMPT "Enter login name : " login
  326.  
  327.           rem    Ask password from keyboard
  328.           rem    --------------------------
  329.           XSET /PROMPT "Enter password : " passwd PASSWD
  330.  
  331.           rem    Connection to several network nodes
  332.           rem    -----------------------------------
  333.         net use node1 ... %login% %passwd%
  334.         net use node2 ... %login% %passwd%
  335.         net use node3 ... %login% %passwd%
  336.  
  337.           rem    Overwrite variable containing password (to be sure)
  338.           rem    --------------------------------------
  339.         set passwd=something_longer_that_password_to_be_sure
  340.  
  341.           rem    Clear variable containing password (to free environment)
  342.           rem    ----------------------------------
  343.         set passwd=
  344.  
  345.           rem -----------------------------------------------------------------
  346.                    
  347.  
  348.  
  349.  
  350.      7)         And much more ...
  351.                 See also DEMO.BAT and ENVEDIT.BAT
  352.  
  353.                                                                     Page 7
  354.  
  355.     Syntax explanation:
  356.     ══════════════════
  357.  
  358.     [...] are optional arguments;
  359.     if they are not specified, a default one is assumed.
  360.  
  361.     {...} are mandatory arguments;
  362.     if they are missing from  the  command-line,  they  are  read  from  the
  363.     standard input device (usually the keyboard or, if using redirection,  a
  364.     file or the output of another command).
  365.  
  366.     Strings arguments have to be included  in  double  quotes  (")  if  they
  367.     contain  any  special  characters   like   characters   interpreted   by
  368.     COMMAND.COM. See remark in section 'Problems'.  This  implies  that  all
  369.     double quotes will  be  removed  from  the  strings  arguments.  Strings
  370.     arguments to option flags also have to be quoted ("")  if  they  contain
  371.     spaces or tabs.
  372.  
  373.  
  374.  
  375.     Input editing:                                                      
  376.     ═════════════
  377.  
  378.     When you input a string from the keyboard, you may use  several  edition
  379.     facilities:
  380.  
  381.     When a default string is proposed:
  382.      - if any editing character (Home, <-, ->, ...) is hit you may edit  the
  383.        proposed string,
  384.      - otherwise, default string is erased and replaced by the new input you
  385.        type in; this feature is only active for the first key you hit.
  386.  
  387.     Valid keys:   Home         Begin of line
  388.                   End          End of line
  389.                   Left/Right   One character left/right
  390.                   Insert       Toggle insert on/off
  391.                   Delete       Delete current  character
  392.                   BackSpace    Delete previous character
  393.                   Ctrl-home    Erase to begin-of-line
  394.                   Ctrl-end     Erase to end-of-line
  395.                   Escape       Erase whole input
  396.                   Enter        Accept input
  397.  
  398.     If  a  timeout  is  specified  (see  /TIMEOUT  flag)  the  function  may
  399.     automatically return if no key is hit before the specified time.
  400.  
  401.  
  402.                                                                     Page 8
  403.  
  404.     Options and commands description:
  405.     ════════════════════════════════
  406.                 
  407.     Remarks: - In the following descriptions, the word 'function' stands for
  408.                both  'option  flag'  and  command.  This  only   means   any
  409.                functionality of XSET. 
  410.  
  411.              - The word 'result' in the option flags description stands  for
  412.                the current contents  of  the  variable  at  the  moment  the
  413.                considered  flag  is  processed  (i.e.,  after  the   already
  414.                executed functions).
  415.  
  416.  
  417.     Input related flags:
  418.     ───────────────────
  419.  
  420.     These are modifiers that can be used with all functions.
  421.  
  422.  
  423.     /DEFAULT
  424.     set current value of variable as default for input.    
  425.  
  426.     ex: set name=SMITH
  427.         XSET/DEFAULT/PROMPT "Enter your name:" name
  428.  
  429.  
  430.     /TIMEOUT  n
  431.     breaks the input if no key was hit after n seconds;  once  any  key  has
  432.     been hit, you may edit your line during any time you need. If you didn't
  433.     hit any key before n seconds, the input is cancelled and  the  resulting
  434.     DOS environment variable is set to  empty  (i.e.,  deleted)  or  to  its
  435.     previous value if the /DEFAULT flag was used. 
  436.  
  437.     - if the time-out delay has been reached, the program will set  the  DOS
  438.       environment variable XSET_MSG to TIME-OUT (to let you check for it),
  439.     - if n = 0, the program will check for type-ahead (i.e., XSET will enter
  440.       into edit mode only if a key was hit at the moment of the check),
  441.     - if n < 0, time-out will be active during the whole input  process;  if
  442.       you wait more than abs(n) seconds between two keys, the  program  will
  443.       return the string typed so far.
  444.     - this option is only active if standard input is not redirected,
  445.     - this option is also active with the KEY command (see further).
  446.  
  447.  
  448.     /LINE  n
  449.     This reads the <n>th line from the standard input device 
  450.     (instead of the first one). 
  451.     -1 will read the last line, 
  452.     -2 will read the line before, ...
  453.                                     
  454.     ex:  dir *.exe | XSET /LINE -2 /word 3 filenb
  455.          This will get the number of files matching *.exe and assign  it  to
  456.          DOS environment variable 'filenb': 
  457.          - read the line before the last one from the output of the 'dir'
  458.            command (something like '   15 file(s)      87912 bytes').
  459.          - pick up the third word on this line.
  460.                 
  461.  
  462.                                                                     Page 9
  463.  
  464.     Prompt related flags:
  465.     ────────────────────
  466.  
  467.     These are modifiers that can be used with all functions.
  468.  
  469.     /PROMPT  string
  470.     Display a message on the screen.
  471.  
  472.     /COLOR  color
  473.     Set color for prompt (and border if any).
  474.     Valid colors: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN  DARKGRAY,
  475.                   LIGHTGRAY, LIGHTBLUE, LIGHTGREEN,  LIGHTCYAN,  LIGHTRED,
  476.                   LIGHTMAGENTA,  YELLOW,  WHITE  
  477.  
  478.     Remark:  If  a  monochrome  video  card  is  detected,  the  /COLOR  and
  479.              /BACKGROUND options will be ignored; if you have a color  video
  480.              card and a monochrome display screen, the colors will be mapped
  481.              by the screen itself as with any other program.
  482.  
  483.     /BACKGROUND  color
  484.     Set background color for prompt (and window if any).
  485.     Valid colors: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, DARKGRAY, 
  486.                   LIGHTGRAY
  487.  
  488.     /BLINK
  489.     To choose a blinking prompt (may be used with /COLOR).
  490.  
  491.     /XPOS  x
  492.     Set cursor to column x (or current - x if x < 0) before displaying prompt.
  493.  
  494.     /YPOS  y
  495.     Set cursor to line y (or current - y if y < 0) before displaying prompt.
  496.                                   
  497.     /WINDOW  left top right bottom
  498.     Draw a window (using color specified with /BACKGROUND).  
  499.     ex:  XSET/BACKGROUND RED /WINDOW 3 2 12 8
  500.          Draw a red window from position (column 3, line 2) to position  
  501.          (column 12, line 8).                       
  502.  
  503.     /BOX
  504.     Draw a window (using color specified with /BACKGROUND) around the prompt
  505.     (specified with /PROMPT); your answer (if any) will be outside the box. 
  506.     ex:  XSET/BACKGROUND RED /BOX /PROMPT "Hello, enter your name:"
  507.          Draw a red window with the prompt inside.
  508.  
  509.     /BORDER
  510.     Add a border inside a window (specified with /WINDOW or /BOX). Rem: When
  511.     using /BORDER, /BOX is assumed by default. If you wish  to  use  /BORDER
  512.     around a user-defined window, both /BORDER and /WINDOW are required. 
  513.  
  514.     ex:  XSET/BACKGROUND RED /BOX /BORDER /PROMPT "Hello, enter your name:"
  515.          XSET/BACKGROUND RED /BORDER /PROMPT "Hello, enter your name:" 
  516.          The two examples above are equivalent.
  517.          XSET/BACKGROUND RED /BORDER /WINDOW 3 2 12 8
  518.  
  519.                                                                     page 10
  520.  
  521.     String related flags:
  522.     ────────────────────
  523.  
  524.     These modifiers can be used with all functions and modify their result.
  525.  
  526.  
  527.     /UPPER - /LOWER  
  528.     This translates the result into upper/lower-cases.
  529.     Characters like éèàâÅ... are also translated to EA... (or ea...).
  530.     - This also affects the arguments given to the KEY command,
  531.     - This also affects the first argument given to the /SEARCH, /INDEX  and
  532.       /CHANGE option flags except if the /REGEXP flag is specified.
  533.  
  534.  
  535.     /LEFT n,  /RIGHT n
  536.     This picks the leftmost / rightmost <n> characters  of  the  result  (or
  537.     less if result is shorter than <n>).
  538.  
  539.     ex: XSET/LEFT 2 drive=%full_pathname%
  540.  
  541.  
  542.     /MID  m  n          
  543.     This picks the <n> characters starting from the <m>th one of the  result
  544.     (or less if result is shorter than <m> + <n>). 
  545.     First character has index 1.
  546.     
  547.     ex: XSET/MID 2 5 var=%other%
  548.         Assigns characters 2, 3, 4, 5 & 6 from %other% to 'var'.
  549.  
  550.            
  551.     /WORD  n
  552.     This picks the <n>th word (separated from other ones by  any  number  of
  553.     blanks) of the result.  
  554.     Other separators may be specified with the /SEPARATOR flag. 
  555.     If no word is found, an empty string is returned.
  556.  
  557.  
  558.     /SEPARATOR  string       
  559.     This uses the characters from 'string' as word separator. 
  560.     This option is intended to be used with /WORD and /COUNT.
  561.  
  562.     ex: XSET/SEPARATOR "+-*/()" /WORD 3 var="25+6*(-72+3)"
  563.         Assigns the string 72 to 'var' (25 is first word, 6 is second, ...).
  564.  
  565.  
  566.     /LENGTH
  567.     This returns the length of the result.
  568.  
  569.  
  570.     /COUNT
  571.     This returns the number of words  (separated  from  other  ones  by  any
  572.     number of blanks) in the result. 
  573.     Other words separators may be specified with the /SEPARATOR flag.
  574.  
  575.                                                                     Page 11
  576.     
  577.     /SEARCH  string       
  578.     This returns the portion of the result matching <string>.
  579.     See also /REGEXP.
  580.  
  581.     ex: XSET/PROMPT "Enter your name: "/UPPER/SEARCH "SMITH" var
  582.         If the answer contains 'SMITH' (even in lower-cases), variable 'var'
  583.         will be assigned to 'SMITH'; otherwise, variable 'var' will be 
  584.         empty.
  585.         
  586.         XSET/REGEXP/SEARCH "[0-9]+" var=%answer%
  587.         Variable 'var' will be assigned to the first occurrence of a  string
  588.         containing only digits (like 2056) from the variable 'answer'.
  589.                                 
  590.     /INDEX  string
  591.     This returns the  index  (position)  of  the  portion  of  the  result
  592.     matching <string>. 
  593.     First character has index 1. 
  594.     See also /REGEXP.
  595.  
  596.  
  597.     /CHANGE  string1  string2    
  598.     This changes (substitutes) all occurrences of <string1> by <string2>  in
  599.     the result.
  600.     
  601.     ex: XSET/CHANGE "oldstr" "newstring" var=%answer%
  602.  
  603.  
  604.  
  605.     Other flags:
  606.     ───────────
  607.  
  608.     /APPEND
  609.     This adds the result to the existing variable instead of overwriting it.
  610.     This allows you to bypass the 128 characters limit of DOS (see /VIEW)
  611.  
  612.     ex:  XSET/APPEND path=";c:\msc600\bin;c:\msc600\binb"
  613.  
  614.  
  615.     /MATH
  616.     This performs a mathematical calculation on the string.
  617.  
  618.     Mathematical operators: 
  619.       - on integer and floating point values:     + - * / () ^ (exponent)
  620.       - on integer values:                        % (modulo) 
  621.  
  622.     Logical operators:      = < > <= >= <>
  623.                             return 1 if true, 0 if false
  624.                             Rem: '*' may be used to 'and' values, 
  625.                                  '+' to 'or' them.
  626.  
  627.     Precedence:   + and - have the highest precedence,
  628.                   all other expressions are evaluated from left to right.
  629.            
  630.     ex: XSET /MATH var = "3+(2*5) + %new% + (%loop% <= 5)"
  631.         XSET /MATH /PROMPT "Enter your calculation" result
  632.  
  633.  
  634.                                                                     Page 12
  635.  
  636.     /REGEXP
  637.     This performs UNIX-like regular expression matching with  the  arguments
  638.     given to the /SEARCH, /INDEX and /CHANGE option flags.
  639.  
  640.     A UNIX-like regular expression is one or more occurrences of one or more
  641.     characters.
  642.  
  643.     The following symbols have a special meaning:
  644.  
  645.        ^  start of line (see also below: 'inside set of characters')
  646.        $  end of line
  647.        .  any character             
  648.        \  quote next character (i.e., do not treat it as a special character)
  649.        *  match zero or more time preceding character (or character set)
  650.        +  match one  or more time preceding character (or character set)
  651.        ?  match one  or zero time preceding character (or character set)
  652.        [] set of characters 
  653.  
  654.        inside set of characters: ^  means non-inclusion
  655.                                  -  means range
  656.       
  657.        ex: [aeiou0-9]   match a, e, i, o, u, and 0 through 9
  658.            [^ae0-9]     match anything but a, e and 0 through 9
  659.            ^a           match any line beginning by 'a'
  660.            v$           match any line ending    by 'v'
  661.  
  662.     ex: XSET /REGEXP /SEARCH "[a-zA-Z]:[a-zA-Z0-9_\\.]+" myvar
  663.         will search for a standard DOS filename (from standard input)
  664.         [a-zA-Z]         match any characters included in the range 
  665.                          'a' to 'z' and 'A' to 'Z'. 
  666.         :                match the character ':'
  667.         [a-zA-Z0-9_\\.]  match any characters included in the range  
  668.                          'a' to 'z', 'A' to 'Z', '0' to '9' and the 
  669.                          characters '_', '\' and '.'.
  670.         \\               match the character following the first '\',
  671.                          is this case a second '\'.
  672.         +                match one or several characters (the preceding  
  673.                          one, which is here a set of characters).  
  674.         This instruction matches any filename of the form 'drive:pathname'
  675.         (ex: C:\DIR\OTHERDIR\FILE.EXT).
  676.  
  677.  
  678.     /ALL     This modifies all DOS environments in memory;  i.e.,  not  only  
  679.              the  current  shell  (COMMAND.COM)  environment  but  also  the
  680.              previous ones (if any). ex: XSET /ALL /APPEND path=";c:\bin"
  681.  
  682.     Warning:  If one of the environments is not big enough  to  contain  the
  683.               new variable, no error message is displayed.
  684.  
  685.  
  686.  
  687.                                                                     page 13
  688.  
  689.     Order of execution of /options:
  690.     ──────────────────────────────
  691.      
  692.     /PROMPT + related (/COLOR, /BACKGROUND, /BLINK, /XPOS, /YPOS,
  693.                        /WINDOW, /BORDER, /BOX)
  694.     input (/DEFAULT, /TIMEOUT, /LINE)
  695.     /UPPER, /LOWER
  696.     /WORD
  697.     /LEFT 
  698.     /RIGHT
  699.     /MID    
  700.     /REGEXP   
  701.     /SEARCH
  702.     /INDEX 
  703.     /CHANGE
  704.     /LENGTH
  705.     /COUNT
  706.     /MATH
  707.     /APPEND
  708.     /ALL
  709.     /VIEW
  710.    
  711.                                                                     page 14
  712.  
  713.     Input commands:
  714.     ──────────────
  715.  
  716.     KEY  [string]
  717.                                                  
  718.     This waits  for  a  key  pressed  and  assign  the  result  to  the  DOS
  719.     environment variable. If a string argument is added to the command, only
  720.     the characters appearing in the string are allowed; if  another  key  is
  721.     hit, you will hear a beep. Printable characters (ASCII code from  32  to
  722.     255) return the character corresponding to the key (ex: A returns  'A').
  723.     Non-printable characters (ASCII code lower than 32) return their decimal
  724.     ASCII code preceded by a '#' (ex: Ctrl-A returns  '#1').  Extended  keys
  725.     (arrows, function keys, Home/end,  PageUp/PageDown,  ...)  return  their
  726.     decimal scan code added to  256  preceded  by  a  '#'  (ex:  F1  returns
  727.     '#315'). See your technical documentation for a list  of  your  keyboard
  728.     scan codes. If you used the /TIMEOUT flag, the program will return after
  729.     the specified time if no valid key was hit. The resulting variable  will
  730.     be empty.
  731.  
  732.       ex:  XSET k KEY 123aAbB       only keys '123aAbB' are allowed
  733.       ex:  XSET k KEY               all keys are allowed
  734.       ex:  XSET/UPPER k KEY  abc    only keys 'aAbBcC' are allowed   
  735.  
  736.                       
  737.     PASSWD                    
  738.     This reads characters from keyboard without echo on screen.
  739.     It is intended to input a password or a secret information.
  740.  
  741.     
  742.                                                                     page 15
  743.  
  744.     Date & time commands:
  745.     ────────────────────          
  746.  
  747.     DATE                      
  748.     This returns the system date in the format 'dd-mm-yy' (ex: 31-12-93).
  749.  
  750.  
  751.     YYMMDD              
  752.     This returns the system's date in the format 'yymmdd' (ex: 931231).
  753.     This format is very useful to generate filenames from the current date.
  754.     
  755.  
  756.     DAY 
  757.     This returns the system's day of the month (1-31)
  758.  
  759.  
  760.     MONTH                     
  761.     This returns the system's month number (1-12)
  762.                                   
  763.  
  764.     YEAR                      
  765.     This returns the system's system year (4 digits - ex: 1993)
  766.                 
  767.  
  768.     DAYOFWEEK                 
  769.     This returns the system's day in the week (0 = sunday, 1 = monday, ... )
  770.        
  771.  
  772.     TIME                      
  773.     This returns the system's time in 24h format 'hh:mm:ss' (ex: 22:15:06)
  774.       
  775.  
  776.     HOUR 
  777.     This returns the system's hour (0-24).
  778.       
  779.  
  780.     MINUTE 
  781.     This returns the system's minutes (0-59).
  782.      
  783.  
  784.     SECOND  
  785.     This returns the system's seconds (0-59).
  786.   
  787.  
  788.     DIFFDATE  date1  date2 
  789.     This returns the number of days between <date1> and <date2>. <date1> and
  790.     <date2> may be of both format from 'dd-mm-yy' or 'yymmdd' (you may  even
  791.     mix them). If <date2> is before <date1>, the result will be negative. 
  792.     Rem: if yy is lesser than 100, 1900 is added (1994 is the same as 94).
  793.                                                                          
  794.  
  795.                                                                     page 16
  796.  
  797.     Disk & file commands:
  798.     ────────────────────
  799.                       
  800.     Remarks: - The filenames given as arguments to these commands may be any
  801.                valid or invalid filenames. They may be an absolute  pathname
  802.                or a relative one. They will never be checked for  existence,
  803.                only their name will be resolved  (canonized)  following  the
  804.                normal DOS conventions.
  805.                   
  806.              - The drive given as arguments to  these  commands  must  be  a
  807.                letter from 'a' to 'z' (or 'A' to Z')  optionally followed by 
  808.                a period ':'.
  809.  
  810.  
  811.     FPATH {file} This returns the full pathname of a filename.
  812.  
  813.     ex: XSET myvar FPATH ..\myprog.exe
  814.         will put in myvar something like 'C:\PROGRAMS\MYPROG.EXE'
  815.  
  816.  
  817.     FDRIVE  {file}       
  818.     This returns the drive of a filename.
  819.  
  820.     ex: XSET myvar FDRIVE myprog.exe
  821.         will put in myvar 'C:'
  822.  
  823.  
  824.     FDIR  {file}
  825.     This returns the drive & directory of a filename.
  826.  
  827.     ex: XSET myvar FDIR c:myprog.exe
  828.         will put in myvar 'C:\PROGRAMS\EXE\'
  829.  
  830.  
  831.     FEXT  {file}       
  832.     This returns the extension of a file name (no period included).
  833.  
  834.     ex: XSET myvar FEXT c:\exe\myprog.exe
  835.         will put in myvar 'EXE'
  836.  
  837.  
  838.     FNAME  {file}       
  839.     This returns the name of a file without extension.
  840.  
  841.     ex: XSET myvar FNAME c:\exe\myprog.exe
  842.         will put in myvar 'MYPROG'
  843.  
  844.  
  845.     FXNAME  {file}       
  846.     This returns the name & extension of a file.
  847.  
  848.     ex: XSET myvar FXNAME h:myprog.exe
  849.         will put in myvar 'MYPROG.EXE'
  850.  
  851.  
  852.                                                                     page 17
  853.  
  854.     TRUENAME  {file}                             
  855.     This returns the full truename of a file, solving all SUBST, ASSIGN  and
  856.     JOIN commands and some network names (for those networks compatible with
  857.     MS_LAN redirector).
  858.  
  859.     ex: XSET myvar TRUENAME myprog.exe
  860.         will put in myvar something like 'C:\PROGRAMS\EXE\MYPROG.EXE'
  861.  
  862.         XSET myvar TRUENAME h:myprog.dat (where h: is SUBSTed to C:\DATA)
  863.         will put in myvar something like 'C:\DATA\MYPROG.DAT'
  864.  
  865.         XSET myvar TRUENAME h:myprog.dat (where h: is a network drive)
  866.         will put in myvar something like '\\SERVER1\SMITH%SMITH\MYPROG.DAT'
  867.  
  868.  
  869.     FSIZE  {file}       
  870.     This returns the size of a file (in bytes).
  871.  
  872.  
  873.     FDATE  {file}       
  874.     This returns the modification date of a file (dd-mm-yy).
  875.  
  876.  
  877.     FTIME  {file}       
  878.     This returns the modification time of a file (hh:mm:ss).
  879.  
  880.  
  881.     DIR  [drive]      
  882.     This returns the current directory of the specified drive. If  no  drive
  883.     is specified, the current one is assumed.
  884.  
  885.  
  886.     VOLLABEL  [drive]      
  887.     This returns the volume label of the specified drive.  If  no  drive  is
  888.     specified, the current one is assumed.
  889.  
  890.  
  891.     BYTEFREE  [drive]      
  892.     This returns the number of bytes free on  the  specified  drive.  If  no
  893.     drive is specified, the current one is assumed.
  894.  
  895.  
  896.                                                                     page 18
  897.  
  898.     DENSITY  [drive]      
  899.     This returns the drive density (in KBytes - 360, 720, 1200, 1440,  2880)
  900.     of the specified floppy drive. If no drive is specified, the current one
  901.     is assumed. This command returns the density of the drive,  not  of  the
  902.     floppy that currently is in it (there is even no need that a  floppy  be
  903.     present in the drive). The program returns  '0'  if  the  drive  has  an
  904.     unknown density or it is not a floppy drive.
  905.  
  906.  
  907.     DRIVETEST  [drive]                                
  908.     This returns  the  status  of  the  specified  drive.  If  no  drive  is
  909.     specified, the current one is assumed. The result is a concatenation  of
  910.     one  or  more  string(s)  from  'READABLE',   'WRITEABLE',   'NOFORMAT',
  911.     'NOTINSERTED', 'INVALID', 'REMOVABLE', 'REMOTE', 'SUBST', 'RAM separated
  912.     by '-'.
  913.  
  914.     ex: XSET test DRIVETEST a:
  915.         This assigns to the variable 'test' a string like:
  916.              'READABLE - WRITEABLE  - REMOVABLE'   (floppy not protected)
  917.           or 'READABLE - REMOVABLE'                (floppy protected)
  918.           or 'NOTINSERTED - REMOVABLE'             (floppy not inserted)
  919.           or 'NOFORMAT - REMOVABLE'                (floppy not formatted)
  920.  
  921.         So, to test if you have write-access to a drive:
  922.         XSET/SEARCH "WRITEABLE" test DRIVETEST a:
  923.         Variable 'test' will contain 'WRITEABLE' or will be empty.
  924.         
  925.  
  926.                                                                     page 19
  927.  
  928.     Other commands:
  929.     ──────────────
  930.     MIN      ┌{str1...strn}
  931.     MAX      └{num1...numn}
  932.  
  933.     This returns the minimum/maximum value of numbers or  strings  list.  If
  934.     not all arguments are numbers, a string comparison (i.e.,  a  comparison
  935.     of ASCII codes of their characters) will be performed. 
  936.  
  937.     Rem: A string may not contain <space> or <tab>.
  938.  
  939.     ex: XSET var MIN 3.6 -4 9.02 %num%    'var'  will  contains  '-4'  
  940.                                           (providing than %num% >= -4)
  941.         XSET var MAX 3.6 $5 abc 3.9j      'var' will contains '$5'
  942.           
  943.  
  944.     CPU                    
  945.  
  946.     This returns the processor type: 86, 186, 286, 386 or 486. The value  86
  947.     is returned for both the 8086 and 8088 (standard XT) processor. There is
  948.     no difference between DX and SX processors. Any non supported  processor
  949.     compatible with a 486 should be reported as 486.
  950.  
  951.  
  952.     RANDOM  n1  n2
  953.  
  954.     This function  returns  a  random  integer  number  between  n1  and  n2
  955.     (included). This may be  useful  to  choose  a  random  message  from  a
  956.     collection, ...
  957.  
  958.  
  959.     ERRORLEVEL
  960.  
  961.     This returns the errorlevel code of the last command issued.
  962.     This function is only valid for 
  963.       - MS-DOS COMMAND.COM 3.20, 3.21, 3.30, 4.0, 4.01, 5.0, 6.0,
  964.       - NDOS 6.0,
  965.       - 4DOS 4.02
  966.     If version is not supported, this returns -1
  967.  
  968.  
  969.     VARCOPY variable
  970.  
  971.     This is strictly equivalent to 'set  dosvar=%variable%'  but  allows  to
  972.     copy variables longer than 128 characters.
  973.                                         
  974.     ex: XSET var2 VARCOPY var1
  975.  
  976.                                                                     page 20
  977.  
  978.     Special flags:
  979.     ─────────────
  980.  
  981.     Note:  The correct syntax  for  XSET  always  needs  a  DOS  environment
  982.            variable name except for the flags described below. There is  one
  983.            other exception; in order to  allow  you  to  use  the  prompting
  984.            facilities  of  XSET  without  actually  using  the   environment
  985.            assignment you may use 
  986.  
  987.                 XSET [/options] /PROMPT "..."
  988.            instead of assigning a dummy variable like
  989.                 XSET [/options] /PROMPT "..." dummy=
  990.            In this case, XSET is only used as an enhanced display program.
  991.  
  992.  
  993.     XSET /CLEAR   deletes all variables from the current DOS environment.
  994.  
  995.  
  996.     XSET /VIEW    shows all variables from the current DOS environment.
  997.                   This  is  strictly  equivalent  to  'SET'  but  will  show
  998.                   variables longer than 128 characters.
  999.  
  1000.     Rem:  If you use XSET to assign values longer than 128 characters  to  a
  1001.           variable, they will appear truncated when  displayed  by  the  DOS
  1002.           command 'SET'. This is only  a  display  problem  of  the  command
  1003.           'SET'; all the variables are correctly  stored  and  can  be  used
  1004.           without problems by any program.
  1005.  
  1006.     XSET /VIEW var   displays the value of variable 'var'.
  1007.                      This is intended  to  be  used  to  pass  a  variable's
  1008.                      content to the standard input of another program.  This
  1009.                      is equivalent to 'ECHO %var%|..." except  that  it  can
  1010.                      handle variables longer than 128 characters and you can
  1011.                      use option flags with it.
  1012.  
  1013.     ex: XSET/LEFT 7 /VIEW myvar | LABEL a:   feed the program  'LABEL'  with
  1014.                                              the first 7 characters of 
  1015.                                              environment 'myvar'.
  1016.  
  1017.         XSET /VIEW > SAVEFILE.VAR            save all environment  variables
  1018.                                              into the file SAVEFILE.VAR.
  1019.  
  1020.  
  1021.     XSET /LOAD    loads variables from standard input.
  1022.                   Variables must have been saved with command 'XSET /VIEW'.
  1023.  
  1024.     ex: XSET /LOAD < SAVEFILE.VAR            load  all environment variables 
  1025.                                              from the file SAVEFILE.VAR.
  1026.  
  1027.  
  1028.     XSET /SIZE   displays environment size and free size (in bytes).
  1029.  
  1030.  
  1031.                                                                     page 21
  1032.  
  1033.      XSET variable:
  1034.      ═════════════   
  1035.      
  1036.      Because you sometimes want to use the same flags for a  group  of  XSET
  1037.      commands (like /UPPER, /DEFAULT, ...), it would be nice to have  a  way
  1038.      to give default options to XSET. And there is such a functionality: the
  1039.      XSET environment variable.
  1040.  
  1041.      Before scanning the command line, the XSET program will  look  for  the
  1042.      'XSET' variable into the current DOS environment.  If  it  exists,  the
  1043.      XSET program will use the variable contents like option flags you would
  1044.      have given onto the command line. After that, it will  use  the  option
  1045.      flags given onto the command line. Note that the command  line  options
  1046.      may overwrite those contained in the 'XSET' variable.
  1047.  
  1048.      ex:      set XSET=/UPPER/DEFAULT/XPOS 5 /BLINK
  1049.               XSET /YPOS 12 /PROMPT "First name: " name1
  1050.               XSET /PROMPT "Last name: " name2
  1051.  
  1052.      This is also a way to reduce the length of your command line  (remember
  1053.      that COMMAND.COM truncates all lines longer than 128 characters).  Note
  1054.      that you may use XSET/APPEND to assign a very long line to  the  'XSET'
  1055.      variable.
  1056.  
  1057.                           
  1058.  
  1059.      XSET_MSG variable:
  1060.      ═════════════════
  1061.      
  1062.      This variable is intended to be assigned by the XSET program itself  to
  1063.      a message to specify special events (like a time-out  on  input,  ...).
  1064.      This variable is updated (or deleted from the  environment)  each  time
  1065.      the program is called. See the related options and commands  to  get  a
  1066.      description of the variable contents.
  1067.  
  1068.      - options and commands using the XSET_MSG variable:
  1069.        /TIMEOUT
  1070.  
  1071.  
  1072.                                                                     page 22
  1073.  
  1074.      Installation:
  1075.      ════════════
  1076.  
  1077.         - XSET.EXE is ready to use; no installation. Just copy XSET.EXE  and
  1078.           XSET.DOC in a directory of your hard drive  (usually  a  directory
  1079.           included in your path). If you want to use the  demo  included  in
  1080.           this package (DEMO.BAT), it must be copied in the  same  directory
  1081.           as the XSET program. Remember this is a SHAREWARE version intended
  1082.           to be used for evaluation.
  1083.  
  1084.         - To get a registered version of XSET, print the XSET.REG file, fill
  1085.           it in and send it to indicated address; you will then receive  the
  1086.           password required  to  register  your  version  with  the  program
  1087.           REGISTER included in the package. 
  1088.           All further upgrades will be free !!!
  1089.                    
  1090.               
  1091.  
  1092.  
  1093.      Problems:
  1094.      ════════
  1095.  
  1096.         - If the size of your environment space is  not  large  enough,  you
  1097.           will receive an error message
  1098.  
  1099.              'XSET : not enough environment space.'
  1100.  
  1101.           This is not a bug, it is because the  environment  space  reserved
  1102.           for the variables is too small. You must increase it by  modifying
  1103.           the line 'SHELL=...' in your CONFIG.SYS. By default, DOS  reserves
  1104.           256 bytes environment space; this is generally  insufficient.  Try
  1105.           640 bytes (or more if you need it) by adding '/e:640' at the  line
  1106.           'SHELL=...'
  1107.  
  1108.           ex:    SHELL=COMMAND.COM /E:640 /P
  1109.  
  1110.  
  1111.           If this problem is encountered in a secondary shell (i.e., you run
  1112.           the batch file from a menu that runs a secondary shell) here is  a
  1113.           way to work around the problem (this is a DOS problem  that  could
  1114.           be avoided by the program that runs the secondary shell):
  1115.  
  1116.           put in your AUTOEXEC.BAT a line such as:
  1117.      SET TO_DELETE=something_very_long_to_be_sure_this_takes_a_lot_of_space
  1118.  
  1119.           and, before using variables in the secondary shell delete this
  1120.                                              ---------
  1121.           variable with the command:
  1122.      SET TO_DELETE=
  1123.  
  1124.  
  1125.           An  other  way  to  work  around  this  limitation  is  to   patch
  1126.           COMMAND.COM; see file 'PATCH.DOS' for more explanation.
  1127.  
  1128.  
  1129.                                                                     page 23
  1130.  
  1131.         - If you use special characters like <>| you  will  have  a  problem
  1132.           because COMMAND.COM interprets these characters  like  redirection
  1133.           commands before giving the control to the program you  call.  This
  1134.           is a general DOS problem, but it is very easy to work around.
  1135.  
  1136.           ex:  XSET /MATH var=(%loop% + 3) > 2   (suppose loop=1)
  1137.                Although you think you call XSET to check  if  4  is  greater
  1138.                than 2, COMMAND.COM interprets it as
  1139.                "put into a file named 2 the result of 'XSET /MATH var (1+3)'"
  1140.  
  1141.           You will have the same result with '<' and '|'.
  1142.           The best way to ensure that all special characters you use will be
  1143.           given 'as is' to the program you call (XSET or another one) is  to
  1144.           enclose your strings between double quotes:
  1145.  
  1146.           XSET /MATH var="(%loop% + 3) > 2"
  1147.  
  1148.           Be careful not to quote XSET reserved words  (commands  or  flags)
  1149.           and variable names.
  1150.           So do not write
  1151.                  XSET var "MIN abc <def> gh"
  1152.             or   XSET "var MIN abc <def> gh"
  1153.             but  XSET var MIN "abc <def> gh"
  1154.  
  1155.  
  1156.  
  1157.         - If you want to use the character '%' in  a  batch  file,  remember
  1158.           that this character is reserved for DOS environment variable;  so,
  1159.           if you want to use a 'real' % character, you have to write '%%' in
  1160.           your batch file.
  1161.  
  1162.           ex: XSET /MATH var="%other_var% %% 7"
  1163.               This line in a batch file will put  into  variable  'var'  the
  1164.               result of '(contents of variable other_var) modulo 7'.
  1165.  
  1166.           Notice that the use of double quotes doesn't affect the  way  that
  1167.           COMMAND.COM interprets the % character;  you  must  double  the  %
  1168.           character even if it is quoted.
  1169.  
  1170.  
  1171.  
  1172.                                                                     page 24
  1173.  
  1174.      Batch file programming: Hints & tips
  1175.      ════════════════════════════════════
  1176.  
  1177.      1. Whenever it is possible, use 'SET var=...' instead of 'XSET var=...'
  1178.         because SET is an internal COMMAND.COM's command and is quicker than
  1179.         calling an external program.
  1180.  
  1181.         ex:  To clear a variable, use    SET myvar=
  1182.                            instead of   XSET myvar=
  1183.                                       
  1184.              If you are sure  that  the  variable  'var1'  is  shorter  than
  1185.              ± 100 characters,    use    SET var2=%var1%
  1186.                            instead of   XSET var2 VARCOPY var1
  1187.  
  1188.                                      
  1189.      2. COMMAND.COM reads and execute batch files one line at a  time;  that
  1190.         means that it reads one line, execute it and rereads the  file  from
  1191.         the beginning to the next line. If you do not have a good disk-cache
  1192.         installed, it is not efficient. Furthermore,  when  using  'REM'  in
  1193.         your batch files to insert a remark, COMMAND.COM reads  the  comment
  1194.         line, execute it (i.e., does nothing) and rereads the file from  the
  1195.         beginning to the next line. To avoid this, there  is  a  trick:  use
  1196.         '::' instead of 'REM'. ':' is understood as a label to  be  used  by
  1197.         the 'GOTO' statement (see your DOS documentation);  this  line  will
  1198.         never be executed. As a label cannot begin with  a  ':',  this  line
  1199.         will not be considered as an executable line, nor as a label.
  1200.         
  1201.         ex:  replace      REM  This batch file is intended to ...
  1202.              by           ::   This batch file is intended to ...
  1203.                          
  1204.  
  1205.      3. To echo an empty line on the screen, use 'ECHO:'
  1206.                           
  1207.  
  1208.      4. To test for the existence of a directory, test for the existence  of
  1209.         the file 'nul.ext' in it (the filename 'nul'  should  be  sufficient
  1210.         except on a Novell network).
  1211.  
  1212.         ex:  if exist c:\mydir\nul.ext echo The directory 'MYDIR' exists.
  1213.                           
  1214.  
  1215.      5. If an environment variable contains a directory name ending  with  a
  1216.         '\', COMMAND.COM will not accept to chdir to this directory.
  1217.  
  1218.         ex:  set dir=c:\mydir\
  1219.              cd %mydir%         ==>  Error message:  Invalid directory
  1220.  
  1221.         The trick (to avoid removing the trailing '\') is to add a '.'
  1222.         ex:  cd %mydir%.        (note the trailing '.')
  1223.               
  1224.  
  1225.      See also DEMO.BAT in this package for other tricks.
  1226.                                                                        
  1227.                                                                     page 25
  1228.  
  1229.      Additional information:
  1230.      ══════════════════════ 
  1231.                 
  1232.      Feel free to contact me for any problem or question.  If  you  have  an
  1233.      electronic mail connection, this is the quickest, cheapest and  easiest
  1234.      way (this would allow me to test your batch files in case  of  problems
  1235.      or bug).
  1236.  
  1237.  
  1238.    Marc Stern 
  1239.    Av. de la Basilique 376 bte 19
  1240.    1080 Bruxelles   
  1241.    Belgium
  1242.       
  1243.    Tel:  +32-2 525.63.32 ( 9h - 16h Central European Time )
  1244.          +32-2 427.98.52 ( after 18h Central European Time )
  1245.  
  1246.    E-mail:  stern@mble.philips.be           (internet)
  1247.             >INTERNET:stern@mble.philips.be (compuserve)
  1248.             see appendix for other networks
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.      APPENDIX:  E-mail address from other sites
  1255.      ════════
  1256.  
  1257.      Rem:  This list is obviously not complete and is  given  here  only  as
  1258.            brute information. It also may contain obsolete  information,  so
  1259.            do not be surprised if  gateway  described  here-below  does  not
  1260.            exist anymore when you try to contact me. If you are connected to
  1261.            another network or  cannot  reach  Internet  with  the  following
  1262.            procedure, ask your network manager.
  1263.  
  1264.  
  1265.  
  1266.   internet   :    stern@mble.philips.be
  1267.  
  1268.   aol        :    stern@mble.philips.be
  1269.   applelink  :    stern@mble.philips.be@internet#
  1270.   att        :    internet!mble.philips.be!stern
  1271.   bitnet     :    stern@mble.philips.be
  1272.   calvacom   :    EM/stern@mble.philips.be
  1273.   compuserve :    >INTERNET:stern@mble.philips.be
  1274.  
  1275.   connect    :    DASN (first line = "stern@mble.philips.be"@DASN)
  1276.  
  1277.   easynet    :    stern@mble.philips.be                (from Ultrix)
  1278.   easynet    :    stern%mble.philips.be@decwrl.dec.com (from Ultrix via IP)
  1279.   easynet    :    DECWRL::"stern@mble.philips.be"      (from Ultrix via Decnet)
  1280.   easynet    :    nm%DECWRL::"stern@mble.philips.be"   (from VMS - NMAIL)
  1281.   easynet    :    stern@mble.philips.be @Internet      (from VMS - All-in-1)
  1282.  
  1283.   envoy      :    [RFC-822="stern(a)mble.philips.be"]INTERNET/TELEMAIL/US
  1284.                                                            
  1285.  
  1286.                                                                     page 26
  1287.  
  1288.   fidonet    :    stern@mble.philips.be ON 1:1/31
  1289.                   or send to UUCP gateway with
  1290.                   first line = "To: stern@mble.philips.be"
  1291.  
  1292.   genie      :    stern@mble.philips.be@INET#
  1293.  
  1294.   geonet     :    DASN (subject line = "stern@mble.philips.be!subject")
  1295.  
  1296.   gold       :    /DD.RFC-822=stern(a)mble.philips.be/O=uknet/PRMD=uk.ac/ADMD=gold 400/C=GB/
  1297.   
  1298.   gsfcmail   :    (SITE:SMTPMAIL,ID:<stern(a)mble.philips.be>)
  1299.                or (C:USA,A:TELEMAIL,P:SMTPMAIL,ID:<stern(a)mble.philips.be>)
  1300.                or POSTMAN (first line = "To: stern@mble.philips.be")
  1301.  
  1302.   keylink    :    (C:au, A:telememo, P:oz.au, "RFC-822":
  1303.   (continuing...) "Marc Stern <stern(a)mble.philips.be>")
  1304.  
  1305.   mausnet    :    stern@mble.philips.be
  1306.  
  1307.   mci        :    To:  Marc Stern (EMS)
  1308.                   EMS: INTERNET
  1309.                   Mbx: stern@mble.philips.be
  1310.  
  1311.   nasamail   :    (site:smtpmail,id:<stern(a)mble.philips.be>)
  1312.  
  1313.   nsi        :    east::"stern@mble.philips.be"
  1314.                or dftnic::"stern@mble.philips.be"
  1315.                or nssdca::in%"stern@mble.philips.be"
  1316.                or jpllsi::"stern@mble.philips.be"
  1317.  
  1318.   omnet      :    type 'compose manual' at the command prompt,
  1319.                   choose 'Internet address' option from the menu,
  1320.                   type 'stern@mble.philips.be'
  1321.  
  1322.   sinet      :    M_MAILNOW::M_INTERNET::"stern@mble.philips.be"
  1323.                or M_MAILNOW::M_INTERNET::mble.philips.be::stern
  1324.  
  1325.   span       :    AMES::"stern@mble.philips.be
  1326.                or HAMLET::"stern@mble.philips.be
  1327.                or IO::"stern@mble.philips.be
  1328.                or IUE::"stern@mble.philips.be
  1329.                or JPLLSI::"stern@mble.philips.be
  1330.                or NSFGW::"stern@mble.philips.be
  1331.                or NSSDCA::"stern@mble.philips.be
  1332.                or STAR::"stern@mble.philips.be
  1333.  
  1334.   sprintmail :    (C:USA,A:TELEMAIL,P:INTERNET,"RFC-822":
  1335.   (continuing...)   <stern(a)mble.philips.be>) DEL
  1336.  
  1337.   thenet     :    UTADNX::WINS%" stern@mble.philips.be "
  1338.  
  1339.   telemail   :    [INTERMAIL/USCISI]TELEMAIL/USA
  1340.                   with first line = Forward: ARPA
  1341.                   and second line = To: stern@mble.philips.be
  1342.  
  1343.   wwivnet    :    stern#mble.philips.be@506
  1344.